package com.eorchis.module.remind.domain;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;
import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.basedata.domain.BaseData;
import com.eorchis.module.reminduserlink.domain.RemindUserLink;

/**
 * Title: Remind<br>
 * Description: 提醒表实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * 
 * @author RongSL
 * @createDate 2016-05-06
 * @version $Revision$
 */
@Entity
@Table(name = "REMIND")
@JsonIgnoreProperties(value={"remindType","remindCategory","RemindUserList"})
public class Remind extends AbstractBaseEntity implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	public static final String XZPXB = "XZPXB"; // 新增培训班
	public static final String WSPXB = "WSPXB"; // 完善培训班
	public static final String FBPXB = "FBPXB"; // 发部培训班
	public static final String CXFBPXB = "CXFBPXB"; // 撤销发布培训班
	public static final String KB = "KB"; // 开班提醒
	public static final String TZME = "TZME"; // 调整名额
	public static final String XYBM = "XYBM"; // 学员报名
	public static final String CXBMSQ = "CXBMSQ"; // 撤销报名申请
	public static final String BMSH = "BMSH"; // 报名审核
	public static final String DBM = "DBM"; // 代报名
	public static final String BMKS = "BMKS"; // 报名开始提醒
	public static final String BMJS = "BMJS"; // 报名结束提醒
	public static final String XYPJ = "XYPJ"; // 学员评价
	public static final String XYPJJS = "XYPJJS"; // 学员评价解锁
	public static final String PGKS = "PGKS"; // 评估开始提醒
	public static final String YQH = "YQH"; // 发邀请函提醒
	
	public static final String TJPXJH="TJPXJH";//提交培训计划
	public static final String SHPXJH="SHPXJH";//审核培训计划
	public static final String XFPXJH="XFPXJH";//下发培训计划
	public static final String TJYJ="TJYJ";//提交意见
	public static final String FBPXJH="FBPXJH";//发布培训计划
//	public  static final String GXTZME="GXTZME";//更新调整名额
	
//	public static final String[] NoSparkRemind=new String[]{Remind.KB,Remind.BMKS,Remind.BMJS,Remind.XYPJ,Remind.PGKS,Remind.YQH};
	public static final String[] NoSparkRemind=new String[]{Remind.BMKS};

	public static final String PXB = "PXB";// 培训班
	public static final String PXJH = "PXJH";// 培训计划

	private String remindId;// ID
	private Integer remindState;// 提醒状态
	private String remindValue;// 提醒内容
	private BaseData remindType;// 提醒类型
	private BaseData remindCategory;// 提醒分类
	private Set<RemindUserLink> RemindUserList = new HashSet<RemindUserLink>();

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "REMIND_ID")
	/**
	 * 设置ID
	 */
	public String getRemindId() {
		return remindId;
	}

	/**
	 * 获取ID
	 */
	public void setRemindId(String remindId) {
		this.remindId = remindId;
	}

	@Column(name = "REMIND_STATE")
	/**
	 * 设置提醒状态
	 */
	public Integer getRemindState() {
		return remindState;
	}

	/**
	 * 获取提醒状态
	 */
	public void setRemindState(Integer remindState) {
		this.remindState = remindState;
	}

	@Column(name = "REMIND_VALUE")
	/**
	 * 设置提醒内容
	 */
	public String getRemindValue() {
		return remindValue;
	}

	/**
	 * 获取提醒内容
	 */
	public void setRemindValue(String remindValue) {
		this.remindValue = remindValue;
	}

	/**
	 * 获取提醒类型
	 */
	@ManyToOne(cascade = { javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.REFRESH }, fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name = "REMIND_CODE", referencedColumnName = "DATA_CODE")
	public BaseData getRemindType() {
		return remindType;
	}

	public void setRemindType(BaseData remindType) {
		this.remindType = remindType;
	}

	/**
	 * 获取消息分类
	 */
	@ManyToOne(cascade = { javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.REFRESH }, fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name = "CATEGORY_CODE", referencedColumnName = "DATA_CODE")
	public BaseData getRemindCategory() {
		return remindCategory;
	}

	public void setRemindCategory(BaseData remindCategory) {
		this.remindCategory = remindCategory;
	}

	/**
	 * 记录日志使用
	 */
	public String toString() {
		return "ID======>" + getRemindId() + "\n提醒状态======>" + getRemindState() + "\n提醒内容======>" + getRemindValue();
	}

	@OneToMany(mappedBy = "remind", fetch = FetchType.LAZY)
	public Set<RemindUserLink> getRemindUserList() {
		return RemindUserList;
	}

	public void setRemindUserList(Set<RemindUserLink> remindUserList) {
		RemindUserList = remindUserList;
	}
}
